import * as types from './action-types'

export const changeSearchUserNameAction = (value) => ({
  type: types['CHANGE_SEARCH_USERNAME'],
  value
})

export const changeSearchRoleAction = (value) => ({
  type: types['CHANGE_SEARCH_ROLE'],
  value
})

export const changeActionKeyAction = (key) => ({
  type: types['CHANGE_ACTIONKEY'],
  key
})

export const changeLoadingAction = (bol) => ({
  type: types['CHANGE_LOADING'],
  bol
})

export const changeFormDataAction = (data) => {
  const formData = {
    type: types['CHANGE_FORMDATA']
  }
  if (data) {
    formData.data = data
  } else {
    formData.data = {
      userName: '',
      phone: '',
      email: '',
      address: '',
      businessName: '',
      telephone : '',
      fox: '',
      status: 1
    }
  }

  return formData
}
